package com.qili.service.supervisor.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.qili.base.mapper.BaseMapper;
import com.qili.base.service.BaseService;
import com.qili.base.service.impl.BaseServiceImpl;
import com.qili.entity.affaircase.dto.AffairCaseDTO;
import com.qili.entity.supervisor.NoticeNew;
import com.qili.entity.supervisor.dto.NoticeNewDTO;
import com.qili.exception.MyException;
import com.qili.mapper.supervisor.NoticeNewMapper;
import com.qili.service.supervisor.NoticeNewServie;
import com.qili.util.ReType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhaoyongke
 * @date 2021/1/17
 * @description
 */
@Service
public class NoticeNewServiceImpl  extends BaseServiceImpl<NoticeNew,String> implements NoticeNewServie {

    @Autowired
    NoticeNewMapper noticeNewMapper;
    @Override
    public BaseMapper<NoticeNew, String> getMappser() {
        return noticeNewMapper;
    }
    @Override
    public ReType queryNoticeList(NoticeNewDTO dto, int page, int limit){
        List<NoticeNewDTO> tList = null;
        Page<NoticeNewDTO> tPage = PageHelper.startPage(page, limit);
        try {
            tList=noticeNewMapper.queryList(dto);
        } catch (MyException e) {
            e.printStackTrace();
        }
        return new ReType(tPage.getTotal(), tList);
    }



}
